/**************************************************************************** 
* 
* Copyright (c) 2023  C*Core -   All Rights Reserved  
* 
* THIS SOFTWARE IS DISTRIBUTED "AS IS," AND ALL WARRANTIES ARE DISCLAIMED, 
* INCLUDING MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* 
* PROJECT     : CCFC2011BC           
* DESCRIPTION : can demo code 
* HISTORY     : Initial version.
* @file     can_demo.h
* @version  1.1
* @date     2023 - 02 - 20
* @brief    Initial version.
*
*****************************************************************************/

#ifndef CAN_DEMO_H_
#define CAN_DEMO_H_

#include "can_lld.h"

union CanFrame {
    uint8_t byte[8];
    struct {
        uint32_t CFG_REQ:2;
        uint32_t CFG_TX_IDE:1;
        uint32_t CFG_TX_EID:18;
        uint32_t CFG_TX_SID:11;
        //
        uint32_t CFG_TX_Other_Data:8;
        uint32_t CFG_TX_Data0:8;
        uint32_t CFG_TX_FDF:1;
        uint32_t CFG_TX_RTR_RRS:1;
        uint32_t CFG_TX_BRS:1;
        uint32_t CFG_TX_ESI_r0:1;
        uint32_t CFG_TX_DLC:4;
        uint32_t CFG_REQ_TEC_REC:2;
        uint32_t CFG_IDX:6;
    } u64;
};
union CanFrameREQ_DATA {
    uint8_t byte;
    struct {
        uint8_t Resv:5;
        uint8_t REQ_DATA_BACK:1;
        uint8_t REQ_TEC_REC:2;
    } B;
};


uint32_t CAN_TEST_Demo(void);

#endif /* CAN_DEMO_H_ */
